/**
 * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 **/

.cart-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

.cart-button {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #007bff;
  color: white;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.cart-button:hover {
  transform: scale(1.1);
  background: #0056b3;
}

.cart-popover {
  position: absolute;
  bottom: 5rem;
  right: 0;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
  padding: 1rem;
}

.cart-empty {
  text-align: center;
  color: #666;
  padding: 2rem;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 1rem;
}

.cart-item-name {
  flex: 1;
  font-size: 0.9rem;
  color: #333;
}

.cart-item-price {
  color: #e44d26;
  font-weight: bold;
  margin: 0 1rem;
}

.cart-item-quantity {
  background: #f0f0f0;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin: 0 0.5rem;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.cart-item-remove:hover {
  color: #dc3545;
}

.cart-total {
  padding: 1rem;
  text-align: right;
  font-weight: bold;
  border-top: 2px solid #eee;
  margin-top: 1rem;
}

.place-order-in-cart {
  width: 100%;
  padding: 0.8rem;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}

.place-order-in-cart:hover {
  background: #218838;
}